home *** CD-ROM | disk | FTP | other *** search
- #
- # A test of intersection of three orthogonal cylinders.
- #
- # Gershon Elber, April 94.
- #
-
- length = 0.7;
- radius = 0.2;
- resolution = 40;
-
- c1 = cylin( vector( -length / 2, 0, 0 ), vector( length, 0, 0 ), radius );
- c2 = cylin( vector( 0, -length / 2, 0 ), vector( 0, length, 0 ), radius );
- c3 = cylin( vector( 0, 0, -length / 2 ), vector( 0, 0, length ), radius );
- attrib( c1, "width", 0.0001 );
- attrib( c2, "width", 0.0001 );
- attrib( c3, "width", 0.0001 );
-
- c12 = c1 * c2;
- c123 = c12 * c3;
- attrib( c123, "width", 0.005 );
-
- all = list( c123, c1, c2, c3 );
-
- sc = 1.1;
- view_mat = scale( vector( sc, sc, sc ) );
- viewobj( view_mat );
-
- tr = 0.4;
- Proj1 = all * trans( vector( -tr, tr, 0.0 ) );
- Proj2 = all * rotx( 90 ) * trans( vector( tr, tr, 0.0 ) );
- Proj3 = all * roty( 90 ) * trans( vector( -tr, -tr, 0.0 ) );
- Proj4 = all * roty( 30 ) * rotx( 20 ) * trans( vector( tr, -tr, 0.0 ) );
-
- AllProj = list( Proj1, Proj2, Proj3, Proj4 );
-
- save( "cylin3a", AllProj );
- view( AllProj, on );
-
- c123a = c123 * roty( 30 ) * rotx( 20 ) * scale( vector( 3, 3, 3 ) );
- attrib( c123a, "width", 0.015 );
- save( "cylin3b", c123a );
- view( c123a, on );
-
- c123b = c123 * roty( 60 ) * rotx( 65 ) * scale( vector( 3, 3, 3 ) );
- attrib( c123b, "width", 0.015 );
- save( "cylin3c", c123b );
- view( c123b, on );
-